/*文件注释
 * ===============================================================================
 * 说明：
 * 作者：zengyy
 * 版本：v1.0
 * 创建日期：2013-06-02 18:32:31
 * 完成日期： 
 * 修改纪录：  
 * ===============================================================================
 */
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using SRF.Common.Validation;

namespace SRF.Admin.Models
{
    ///<summay>
    /// 权限项
    ///</summay>
    [Serializable]
    public class Permission
    {
        #region 属性

        /// <summary>
        /// 
        /// </summary> 
        [DisplayName("Id")]
        public string Id { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        [StringLength(50)]
        [Required(ErrorMessage = "请输入名称")]
        [DisplayName("名称")]
        public string Name { get; set; }
        /// <summary>
        /// 编码
        /// </summary>
        [StringLength(50)] 
        [DisplayName("编码")]
        public string Code { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        [StringLength(100)]
        [DisplayName("地址")]
        public string Url { get; set; }

        /// <summary>
        /// 上级模块
        /// </summary>
        [DisplayName("上级模块")]
        public string ParentId { get; set; }
        /// <summary>
        /// 说明
        /// </summary>
        [StringLength(50)]
        [DisplayName("说明")]
        public string Remark { get; set; }
        
        [Required(ErrorMessage = "请输入类型")]
        [DisplayName("类型")]
        public PermissionType Type { get; set; }

        #endregion
    } 
    public enum PermissionType
    {
        [Description("模块")]
        Module = 1,
        [Description("功能")]
        Action = 2
    }
}